import { phoneCheck } from '@/utils/rulesFunction'

export const rules = {
  supplierName: [
    { required: true, message: '供应商名称不能为空', trigger: 'blur' }
  ],
  supplierCode: [
    { required: true, message: '供应商编码不能为空', trigger: 'blur' }
  ],
  supplierType: [
    { required: true, message: '供应商类别不能为空', trigger: 'blur' }
  ],
  cityCode: [
    { required: true, message: '所属城市不能为空', trigger: 'change' }
  ],
  countyCode: [
    { required: true, message: '所属区县不能为空', trigger: 'change' }
  ],
  storeId: [{ required: true, message: '所属门店不能为空', trigger: 'change' }],
  contactName: [{ required: true, message: '联系人不能为空', trigger: 'blur' }],
  contactPhone: [{ required: true, trigger: 'blur', validator: phoneCheck }],
  address: [{ required: true, message: '供应商地址不能为空', trigger: 'blur' }],
  companyName: [
    { required: true, message: '公司全称不能为空', trigger: 'blur' }
  ],
  categoryIds: [
    { required: true, message: '精品类别不能为空', trigger: 'blur' }
  ]
}
